#ifndef READYFORTAKEOFF_H
#define READYFORTAKEOFF_H

#include "state.h"
#include "../eventmanager.h"
#include "../manager.h"
#include "../route.h"
#include "../properties.h"

namespace state {

struct ReadyForTakeoff : public State {
	ReadyForTakeoff(int id) : State(id) {}
	
	virtual void onEnter() {
		Manager::Instance().getRoute()->switchToRollingLeg();

		PropAccessor p;
		p().fcs.roll.set(Roll_Neutral);
		p().fcs.pitch.set(Pitch_Neutral);
		p().fcs.yaw.set(Yaw_Neutral);
		p().fcs.throttle.set(Throttle_Value, 0);
		p().fcs.flaps.set(Flaps_Value, Flaps_Value_Takeoff);
		p().fcs.brakes.set(Brakes_Value, 0);
		p().fcs.watcher = Watcher_Idle;
		
		p().air_data.reset_alt = true;

		p().fcs.parachute_armed = false;
		
		p().fcs.state = getId();
	}
};

}

#endif
